//
//  ActivityTableViewCell.m
//  UI_元旦豆瓣电影
//
//  Created by dllo on 16/1/5.
//  Copyright © 2016年 lanou3g. All rights reserved.
//

#import "ActivityTableViewCell.h"
#import "ActivityModel.h"
#import "UIImageView+WebCache.h"
@interface ActivityTableViewCell ()

@property (retain, nonatomic) IBOutlet UIImageView *imgV;

@property (retain, nonatomic) IBOutlet UILabel *timeL;

@property (retain, nonatomic) IBOutlet UILabel *addressL;
@property (retain, nonatomic) IBOutlet UILabel *categroyL;

@property (retain, nonatomic) IBOutlet UILabel *wishL;

@property (retain, nonatomic) IBOutlet UILabel *pL;
@property (retain, nonatomic) IBOutlet UILabel *titleL;

@end

@implementation ActivityTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


- (void)setModel:(ActivityModel *)model {
    if (_model != model) {
        [_model release];
        _model = [model retain];
        [self fuZhi];
    }
}

- (void)fuZhi {
    [_imgV sd_setImageWithURL:[NSURL URLWithString:_model.image]];
    _timeL.text = [NSString stringWithFormat:@"%@ -- %@", [_model.begin_time substringWithRange:NSMakeRange(5, 11)], [_model.end_time substringWithRange:NSMakeRange(5, 11)]];
    _addressL.text = _model.address;
    _categroyL.text = _model.category_name;
    _titleL.text = _model.title;
    _wishL.text = [_model.wisher_count stringValue];
    _pL.text = [_model.participant_count stringValue];
    
}


- (void)dealloc {
    [_imgV release];
    [_timeL release];
    [_addressL release];
    [_categroyL release];
    [_wishL release];
    [_pL release];
    [_titleL release];
    [super dealloc];
}
@end
